import request from '/@/utils/request'

const api = '/api/car'

// 获取
export function getCarList(params: any) {
  return request({
    url: `${api}`,
    method: 'get',
    params,
  })
}

// 增加
export function addCar(data: any) {
  return request({
    url: `${api}`,
    method: 'post',
    data,
  })
}

// 修改
export function updateCar(data: any) {
  return request({
    url: `${api}/${data.id}`,
    method: 'put',
    data,
  })
}

// 删除
export function deleteCar(id: string | number) {
  return request({
    url: `${api}/${id}`,
    method: 'delete',
  })
}
